package com.hsource.common.utils.resultUtils.controller;

import com.hsource.common.utils.CommonCallBackResp;
import com.hsource.common.utils.CommonResp;

public class BaseController {

    /**
     * 操作成功 返回指定信息及数据
     * @param msg
     * @param data
     * @return
     */
    public static CommonResp success(String msg, Object data) {
        CommonResp commonResp=new CommonResp();
        return commonResp.success(msg,data);
    }

    /**
     * 操作成功 无数据
     * @return
     */
    public static CommonResp success() {
        CommonResp commonResp=new CommonResp();
        return commonResp.success();
    }

    /**
     * 操作成功返回数据
     * @param data
     * @return
     */
    public static CommonResp success(Object data) {
        CommonResp commonResp=new CommonResp();
        return commonResp.success(data);
    }


    /**
     * 操作失败
     * @return
     */
    public static CommonResp failed() {
        CommonResp commonResp=new CommonResp();
        return commonResp.failed();
    }
    /**
     * 操作失败
     * @return
     */
    public static CommonResp failed(Integer code) {
        CommonResp commonResp=new CommonResp();
        return commonResp.failed(code);
    }

    /**
     * 操作失败
     * 更新操作信息
     * @return
     */
    public static CommonResp failed(String msg){
        CommonResp commonResp=new CommonResp();
        return commonResp.failed(msg);
    }

    public static CommonCallBackResp callBackSuccess(){
        CommonCallBackResp commonCallBackResp=new CommonCallBackResp();
        return commonCallBackResp.success();
    }
    public static CommonCallBackResp callBackFailed(){
        CommonCallBackResp commonCallBackResp=new CommonCallBackResp();
        return commonCallBackResp.failed();
    }
}
